var app = getApp()
Page({
  data: {
    nomore:true,
    objarr: [],
    height: 0,
  },
  onLoad: function (e) {
    var self = this;
    wx.getSystemInfo({
      success: function (res) {
        console.log(res);
        self.setData({ height: res.windowHeight - 50 })
      }
    })
    
  },
  searchdo(e){ 
    let str = e.detail.value
    let params = {
      keywords: str,
      rd_session: app.globalData.userInfo.rd_session
    }
    app.ajax("search_good", params, (data, err) => {
      if(data.result == 'success'){
        this.setData({
          objarr: data.data.list,
        })
      }else{
        wx.showToast({
          title: '没有相关产品哦',
        })
      }
      
    })
  },
  toinfo: function (e) {
    let id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/goods/goods_detail_buy?id=' + id + '&status=' + 'good',
    })
  },
  
});